
package com.gz.im.backend.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.client.codec.StringCodec;
import org.redisson.codec.IonJacksonCodec;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.codec.SerializationCodec;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author GuoZhong
 * @description redisson
 * @date 2023/3/28 9:41
 */


@Configuration
public class RedissonConfig {
	@Bean(destroyMethod = "shutdown")
	public RedissonClient redissonClient(){
		// 创建配置 指定redis地址及节点信息
		Config config = new Config();
		config.useSingleServer().setAddress("redis://192.168.200.130:6379");
		RedissonClient redissonClient = Redisson.create(config);
		return redissonClient;
	}
}

